<template>
  <div>
    {{ obj.shopName }} <button @click="add">+</button>{{ obj.count
    }}<button @click="del">-</button>
  </div>
</template>

<script>
export default {
    //对象传值，直接修改
  props: ["obj", "index"],
  methods: {
    add() {
      return (this.obj.count += 1);
    },
    del() {
      return (this.obj.count = this.obj.count
        ? (this.obj.count -= 1)
        : this.obj.count);
    },
  },
};
</script>

<style></style>
